#ifndef __DEF_CHARTPK_H__
#define __DEF_CHARTPK_H__

#include <wx/wx.h>
#include <vector>

using namespace std;

typedef enum _directflg {
	HORIZONTAL = 0,
	VERTICAL
} directFlag;
#define MINIMUMSIZE 5
#define VALIDSIZE 4

class ValueInformation
{
public:
	ValueInformation() { }
	~ValueInformation() { }
	wxArrayInt data;
	wxArrayString label;
	wxColour color;
};
WX_DECLARE_OBJARRAY(ValueInformation, ValueInformationArray);

class ChartPicker : public wxScrolledWindow
{
public:
	ChartPicker(wxWindow *parent,wxWindowID id, directFlag dflg, const wxPoint &pos, const wxSize &size, int min = 0, int max = 100, int vmin = 0, int vmax = 100);
	~ChartPicker(void);
	void Repaint(void);
	void Freeze(void);
	bool DrawChart(const wxArrayInt &param);
	void OnPaint( wxPaintEvent &event );
	
	//getter
	int GetMin(void) { return minrange; };
	int GetMax(void) { return maxrange; };
	int GetValueMin(void) { return vminrange; };
	int GetValueMax(void) { return vmaxrange; };
	int GetValue(int index);
	wxFont GetChartFont(void) { return ufont; }

	//setter
	bool SetRange(int min, int max);
	bool SetValueRange(int min, int max);
	bool SetValue(int index, int value);
	void SetValueName(const wxArrayString &v,const wxArrayString &h);
	void SetBgColor(const wxColour &bg);
	void SetColor(const wxColour &cl);
	void SetHelperLine(int v = -1, int h = -1);
	void SetHelperValue(bool v = false, bool h = false);
	void SetHelperStyle(const wxPen &pen);
	void SetChartTitle(const wxString &name, int x, int y);
	void AddData(const wxArrayInt &param, wxArrayString &label, wxColour &color);
	void DelData(int index);
	void SetChartFont(const wxFont &font) { ufont = font; }
public:
	bool border;
	bool lineborder;
private:
	DECLARE_EVENT_TABLE()
protected:
	int minrange;
	int maxrange;
	int vminrange;
	int vmaxrange;
	wxArrayInt value;
	ValueInformationArray multivalue;
	directFlag direct;
	wxColour bgcolor;
	wxColour color;
	int lnwidth;
	int lnheight;
	bool drawon;
	int helpVertical;
	int helpHorizontal;
	bool helpVflag;
	bool helpHflag;
	wxPen helpPen;
	wxString stitle;
	int stitle_x;
	int stitle_y;
	wxArrayString VName;
	wxArrayString HName;
	wxFont ufont;
};

#endif
